import java.util.Stack;

public class Test {
    public static void main(String[] args) {
        Stack<Integer> stack=new Stack<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.pop();//出栈
int x=stack.peek();//查看栈顶元素
        System.out.println(x);
    }
}
